package com.xuanwei.web.controller;

import com.xuanwei.core.cache.CategoryCache;
import com.xuanwei.core.response.ResultVO;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author jiangyong
 * @Description TODO
 * @Date 2019/7/5 16:36
 **/
@RestController
@RequestMapping("wx/category")
public class CategoryController {

    private CategoryCache  categoryCache;

    public CategoryController(CategoryCache categoryCache) {
        this.categoryCache = categoryCache;
    }

    @RequestMapping(value = "index", method = RequestMethod.GET)
    public ResultVO category(){
         return ResultVO.successResult(categoryCache.getCategory());
    }
}
